package com.avetti.commerce.domainmodel;

import java.io.Serializable;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

/** @author Hibernate CodeGenerator */
public class Options implements Serializable {

    
	private static final long serialVersionUID = 1L;

	/** identifier field */
    private Long optionid;

    /** persistent field */
    private long attributeid=0;

    /** nullable persistent field */
    private int choice=0;

    /** nullable persistent field */
    private String ddtext="0";

    /** nullable persistent field */
    private String code;

    /** nullable persistent field */
    private String item;

    /** nullable persistent field */
    private String price;

    /** nullable persistent field */
    private double weight=0;

    /** persistent field */
    private short def=1;

    /** persistent field */
    private long oldoptionid=0;

    /** persistent field */
    private short upd=0;

    /** full constructor */
    public Options(Long optionid, long attributeid, int choice, String ddtext, String code, String item, String price, double weight, short def, long oldoptionid, short upd) {
        this.optionid = optionid;
        this.attributeid = attributeid;
        this.choice = choice;
        this.ddtext = ddtext;
        this.code = code;
        this.item = item;
        this.price = price;
        this.weight = weight;
        this.def = def;
        this.oldoptionid = oldoptionid;
        this.upd = upd;
    }

    /** default constructor */
    public Options() {
    }

    /** minimal constructor */
    public Options(Long optionid, long attributeid, short def, long oldoptionid, short upd) {
        this.optionid = optionid;
        this.attributeid = attributeid;
        this.def = def;
        this.oldoptionid = oldoptionid;
        this.upd = upd;
    }

    public Options(Options options) {
        this.optionid = new Long(options.optionid);
        this.attributeid = options.attributeid;
        this.choice = options.choice;
        this.ddtext = options.ddtext == null ? null : new String(options.ddtext);
        this.code = options.ddtext == null ? null : new String(options.code);
        this.item = options.ddtext == null ? null : new String(options.item);
        this.price = options.price == null ? null : new String(options.price);
        this.weight = options.weight;
        this.def = options.def;
        this.oldoptionid = options.oldoptionid;
        this.upd = options.upd;
    }

    public Long getOptionid() {
        return this.optionid;
    }

    public void setOptionid(Long optionid) {
        this.optionid = optionid;
    }

    public long getAttributeid() {
        return this.attributeid;
    }

    public void setAttributeid(long attributeid) {
        this.attributeid = attributeid;
    }

    public int getChoice() {
        return this.choice;
    }

    public void setChoice(int choice) {
        this.choice = choice;
    }

    public String getDdtext() {
        return this.ddtext;
    }

    public void setDdtext(String ddtext) {
        this.ddtext = ddtext;
    }

    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getItem() {
        return this.item;
    }

    public void setItem(String item) {
        this.item = item;
    }

    public String getPrice() {
        return this.price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public double getWeight() {
        return this.weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    public short getDef() {
        return this.def;
    }

    public void setDef(short def) {
        this.def = def;
    }

    public long getOldoptionid() {
        return this.oldoptionid;
    }

    public void setOldoptionid(long oldoptionid) {
        this.oldoptionid = oldoptionid;
    }

    public short getUpd() {
        return this.upd;
    }

    public void setUpd(short upd) {
        this.upd = upd;
    }

    public String toString() {
        return new ToStringBuilder(this)
            .append("optionid", getOptionid())
            .toString();
    }

    public boolean equals(Object other) {
        if ( !(other instanceof Options) ) return false;
        Options castOther = (Options) other;
        return new EqualsBuilder()
            .append(this.getOptionid(), castOther.getOptionid())
            .isEquals();
    }

    public int hashCode() {
        return new HashCodeBuilder()
            .append(getOptionid())
            .toHashCode();
    }

}
